package singleton;

/**
 * @author shenhan
 * @create 2020/3/18 22:47
 * @description 枚举
 */
public enum Singleton7 {
    /**
     * sss
     */
    INSTANCE;

    public void say() {
        System.out.println("ok");
    }

    public static void main(String[] args) {
        final Singleton7 instance = Singleton7.INSTANCE;
        final Singleton7 instance2 = Singleton7.INSTANCE;
        System.out.println(instance == instance2);
        System.out.println(instance.hashCode());
        System.out.println(instance2.hashCode());
        instance.say();
    }
}
